<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

// 检查类是否存在，如果不存在则手动加载
if (!class_exists(\Webman\Event\BootStrap::class)) {
    // 尝试从不同可能的路径加载
    $possiblePaths = [
        __DIR__ . '/../../../vendor/webman/event/src/BootStrap.php',
        dirname(dirname(dirname(dirname(__DIR__)))) . '/vendor/webman/event/src/BootStrap.php',
    ];
    
    // 如果 base_path 函数可用，也尝试使用它
    if (function_exists('base_path')) {
        $possiblePaths[] = base_path() . '/vendor/webman/event/src/BootStrap.php';
    }
    
    foreach ($possiblePaths as $bootstrapFile) {
        $realPath = realpath($bootstrapFile);
        if ($realPath && file_exists($realPath)) {
            require_once $realPath;
            break;
        }
    }
}

// 如果类存在，则返回，否则返回空数组避免警告
if (class_exists(\Webman\Event\BootStrap::class)) {
    return [
        \Webman\Event\BootStrap::class,
    ];
}

// 如果类仍然不存在，返回空数组以避免警告
return [];
